package com.example.utils;

import com.example.pojo.SysUser;

public class UserThreadLocal {

    //构造函数私有化
    private UserThreadLocal(){}

    //线程变量隔离(线程安全)
    public static final ThreadLocal<SysUser>LOCAL=new ThreadLocal<>();

    public static void put(SysUser sysUser){
        LOCAL.set(sysUser);
    }
    public static SysUser get(){
        return LOCAL.get();
    }
    public static void remove(){
        LOCAL.remove();
    }


}
